<style lang="scss" scoped>
.icon {
	width: 1.4em;
	height: 1.4em;
	vertical-align: -0.3em;
	fill: currentColor;
	overflow: hidden;
}
</style>

<template>
	<span v-bind="$attrs">
		<svg :class="className" class="icon" aria-hidden="true">
			<use :href="`#icon-${name}`" />
		</svg>
	</span>
</template>

<script setup>
defineProps({
	// 图标名称，不带前缀
	name: {
		type: String,
		required: false,
		default: 'home',
	},

	// 图标的类名
	className: {
		type: String,
		required: false,
		default: '',
	},
});
</script>
